<template>
  <div class="home">
    <section class="hero">
      <div class="hero-content">
        <h1>欢迎来到我的创作世界</h1>
        <p>在这里，您可以欣赏到我的最新作品和创作历程</p>
        <router-link to="/gallery" class="btn">查看作品集</router-link>
      </div>
    </section>
    
    <section class="featured-works">
      <h2>精选作品</h2>
      <div class="works-grid">
        <div class="work-card" v-for="work in featuredWorks" :key="work.id">
          <img :src="work.image" :alt="work.title">
          <div class="work-info">
            <h3 v-text="work.title"></h3>
            <p v-text="work.description"></p>
          </div>
        </div>
      </div>
    </section>
    
    <section class="about">
      <h2>关于我</h2>
      <p>我是一名热爱创作的艺术家，专注于视觉设计和摄影。通过我的作品，我希望能够传达情感、讲述故事，并与观众建立深刻的连接。</p>
      <router-link to="/resume" class="btn">了解更多</router-link>
    </section>
  </div>
</template>

<script setup>
import { ref } from 'vue'

const featuredWorks = ref([
  {
    id: 1,
    title: '城市夜景',
    description: '捕捉都市夜晚的繁华与宁静',
    image: 'https://picsum.photos/seed/1/600/400'
  },
  {
    id: 2,
    title: '自然风光',
    description: '展现大自然的壮丽与和谐',
    image: 'https://picsum.photos/seed/2/600/400'
  },
  {
    id: 3,
    title: '人物肖像',
    description: '通过镜头捕捉人物的内心世界',
    image: 'https://picsum.photos/seed/3/600/400'
  }
])
</script>

<style scoped>
.hero {
  background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('https://picsum.photos/seed/hero/1600/900') center/cover no-repeat;
  height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: inherit;
  filter: blur(5px);
  z-index: -1;
}

.hero-content {
  max-width: 800px;
  padding: 20px;
}

.hero-content h1 {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-content p {
  font-size: 1.3rem;
  margin-bottom: 2rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.featured-works,
.about {
  max-width: 1200px;
  margin: 60px auto;
  padding: 0 20px;
}

.featured-works h2,
.about h2 {
  text-align: center;
  margin-bottom: 40px;
  font-size: 2.2rem;
  color: #333;
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.work-card {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.4s ease;
  background: white;
}

.work-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.work-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.work-info {
  padding: 20px;
}

.work-info h3 {
  margin: 0 0 12px 0;
  font-size: 1.4rem;
  color: #333;
}

.work-info p {
  color: #666;
  line-height: 1.5;
}

.about {
  text-align: center;
  background: linear-gradient(to bottom, #ffffff, #f8f9fa);
  padding: 60px 20px;
  border-radius: 12px;
}

.about p {
  max-width: 800px;
  margin: 0 auto 30px;
  font-size: 1.2rem;
  line-height: 1.7;
  color: #555;
}
</style>